﻿using Hello.Api.Contracts;
using MassTransit;

namespace Hello.Api.Consumers
{
    public class MessageConsumer : IConsumer<Message>
    {
        private readonly ILogger<MessageConsumer> _logger;
        public MessageConsumer(ILogger<MessageConsumer> logger)
        {
            _logger = logger;
        }
        public Task Consume(ConsumeContext<Message> context)
        {
            //throw new ArgumentException(nameof(context));
            _logger.LogInformation($"Message received: {context.Message.Text}");
            //Task.Delay(10000);
            return Task.CompletedTask;
        }
    }
}
